<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Encore\Admin\Facades\Admin;
class crm_customer extends Model
{
    //客户管理
    protected $table = 'crm_customer';
    public $timestamps = false;
    protected $fillable = ['customer_laiyuan','customer_name','customer_age','customer_sex','customer_phone','customer_weixin','customer_qq','customer_email','customer_sfz','customer_danwei','customer_weihu','customer_kfdate','customer_type','customer_shengri'];
    // 工单表模型关联
    public function crm_order()
    {
        return $this->hasOne('App\crm_order','order_customerid', 'id');
    }
    // 维护员工模型关联
    public function admin_users()
    {
        return $this->belongsTo('App\Admin_users','customer_weihu', 'id');
    }
    // 开发员工模型关联
    public function kaifa()
    {
        return $this->belongsTo('App\Admin_users','customer_kaifa', 'id');
    }
   
}
